<?php include_once '../Model/AttachedFileDao.php';?>
<?php
    if(isset($_GET['id'])){
        $result = getContentFile($_GET['id']);
        $name = $result[0]['name'];
        $size = $result[0]['size'];
        $type = $result[0]['type'];
        $content = $result[0]['content'];
        
        header("Content-length: $size");
        header("Content-type: $type");
        header("Content-Disposition: attachment; filename=$name");
        echo $content;
        exit;
    }

?>